<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://apps.bdimg.com/libs/underscore.js/1.7.0/underscore-min.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/backbone.js/1.1.2/backbone-min.js"></script>
</head>
<body>

</body>
<script>
      var list = [
          {
              title:'title1',
              decriptton:'decriptton1'
          },
          {
              title:'title2',
              decriptton:'decriptton2'
          },
          {
              title:'title3',
              decriptton:'decriptton1'
          }
      ];

      var MyList = Backbone.Collection.extend({

      })
      var alist = new MyList(list);
        //console.log(alist,alist.toJSON(),alist.size());
        //查查一个
        var foo = alist.find(function(model){
            //console.log(model.toJSON())
            console.log( model.get('decriptton'))
            return model.get('title') == 'title1'
      })
      //查查多个
      var foo2 = alist.filter(function(model){
          //console.log(model.toJSON())

          return model.get('title') == 'title1'
      })
       //查询
      var foo3 = alist.where({
          decriptton:'decriptton1'
      },true)
      //遍历
        var foo4 = alist.each(function(model){
           // console.log(model.toJSON())
      })
      //每个必须满足条件 Boolean
      var foo5 = alist.every(function(model){
            return model.get('title') !==null
      })
      //一个满足条件 Boolean
      var foo8 = alist.some(function(model){
          //console.log(model.get('title') !== null)
          return model.get('title') == null
      })
      //取到相同属性, Boolean  array
      var foo9 = alist.pluck('title')

      var foo7 = alist.map(function(model){
          return model.get('decriptton')
      })
      var foo10 = alist.reduce(function(memo,model,index){
           if(memo == '')  return  model.get('decriptton');
          return memo +','+ model.get('decriptton')

      },'')
</script>
</html>